

import Vue from 'vue'
import VueRouter from 'vue-router'
//导入 视图组件
import emp from "../view/emp/emp"
import dept from "../view/dept/dept"
import user from "../view/user/user"
import role from "../view/role/role"
import power from "../view/menu/power"
import menu from "../view/menu/menu"
import roleAllot from "../view/role/roleAllot"
import login from "../view/commons/login"
import verify from "../view/commons/verify"

import index from '../view/index'
//注册路由表
Vue.use(VueRouter)

//创建路由映射
const routes = [
    //一个路径绑定一个vue组件
    { path: '/login', component: login },
    { path: '/verify', component: verify },
    {
        path: '/', component: index, children: [

            { path: '/emp', component: emp },
            { path: '/dept', component: dept },
            { path: '/user', component: user },
            { path: '/role', component: role },
            { path: '/power', component: power },
            { path: '/menu', component: menu },
            { path: '/roleAllot/:id', component: roleAllot },

        ]
    },



]
//导出路由表组件
export default new VueRouter({

    routes,
})
